package ade.prime.model;

import ade.prime.service.ScheduleUpdateProgress;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * @author		Schnell Michaël
 */
public enum ScheduleState implements Parcelable {

	OTHER, NOT_UPDATED, WAITING_FOR_UPDATE, UPDATING, UPDATED ;
	
	public static final Parcelable.Creator<ScheduleState> CREATOR = 
			new Creator<ScheduleState>() {
		
		@Override
		public ScheduleState[] newArray(int size) {
			return new ScheduleState[size] ;
		}// newArray(int)
		
		@Override
		public ScheduleState createFromParcel(Parcel source) {
			int ordinal = source.readInt() ;
			ScheduleState state = ScheduleState.values()[ordinal] ;
			state.step = source.readParcelable(this.getClass().getClassLoader()) ;
			return state ;
		}// createFromParcel(Parcel)
		
	} ;
	
	public ScheduleUpdateProgress step ;

	@Override
	public int describeContents() {
		return 0 ;
	}// describeContents()

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(this.ordinal()) ;
		dest.writeParcelable(this.step, flags) ;
	}// writeToParcel(Parcel, int)	
	
}// enum ScheduleState